home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / nfs / amd / amd-5.2 / include / uwait.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-23  |  2.5 KB  |  69 lines

  1. /*
  2.  * $Id: uwait.h,v 5.2 90/06/23 22:20:31 jsp Rel $
  3.  *
  4.  * Copyright (c) 1989 Jan-Simon Pendry
  5.  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  6.  * Copyright (c) 1989 The Regents of the University of California.
  7.  * All rights reserved.
  8.  *
  9.  * This code is derived from software contributed to Berkeley by
  10.  * Jan-Simon Pendry at Imperial College, London.
  11.  *
  12.  * Redistribution and use in source and binary forms are permitted provided
  13.  * that: (1) source distributions retain this entire copyright notice and
  14.  * comment, and (2) distributions including binaries display the following
  15.  * acknowledgement:  ``This product includes software developed by the
  16.  * University of California, Berkeley and its contributors'' in the
  17.  * documentation or other materials provided with the distribution and in
  18.  * all advertising materials mentioning features or use of this software.
  19.  * Neither the name of the University nor the names of its contributors may
  20.  * be used to endorse or promote products derived from this software without
  21.  * specific prior written permission.
  22.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  23.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  24.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  25.  *
  26.  *    %W% (Berkeley) %G%
  27.  */
  28.  
  29. #if defined(mc68k) || defined(mc68000) || defined(mc68020) || defined(sparc) || defined(hp9000s300)
  30. #define BITS_BIGENDIAN
  31. #endif
  32. #if defined(vax) || defined(i386)
  33. #define BITS_LITTLENDIAN
  34. #endif
  35. #if !defined BITS_BIGENDIAN && !defined BITS_LITTLENDIAN
  36.  #error Do not know my byte ordering
  37. #endif
  38.  
  39. /*
  40.  * Structure of the information in the first word returned by both
  41.  * wait and wait3.  If w_stopval==WSTOPPED, then the second structure
  42.  * describes the information returned, else the first.  See WUNTRACED below.
  43.  */
  44. union wait    {
  45.     int    w_status;        /* used in syscall */
  46.     /*
  47.      * Terminated process status.
  48.      */
  49.     struct {
  50. #ifdef BITS_LITTLENDIAN
  51.         unsigned short    w_Termsig:7;    /* termination signal */
  52.         unsigned short    w_Coredump:1;    /* core dump indicator */
  53.         unsigned short    w_Retcode:8;    /* exit code if w_termsig==0 */
  54. #endif
  55. #ifdef BITS_BIGENDIAN
  56.         unsigned short    w_Fill1:16;    /* high 16 bits unused */
  57.         unsigned short    w_Retcode:8;    /* exit code if w_termsig==0 */
  58.         unsigned short    w_Coredump:1;    /* core dump indicator */
  59.         unsigned short    w_Termsig:7;    /* termination signal */
  60. #endif
  61.     } w_U;
  62. };
  63. #define    w_termsig    w_U.w_Termsig
  64. #define w_coredump    w_U.w_Coredump
  65. #define w_retcode    w_U.w_Retcode
  66.  
  67. #define WIFSIGNALED(x)    ((x).w_termsig != 0)
  68. #define WIFEXITED(x)    ((x).w_termsig == 0)
  69.